<template>
  <div style="min-height: 300px">
    <a-form :model="entity" :rules="rules" label-width="120px">
      <a-form-item label="工序编码" field="code">
        <a-input v-model="entity.code"  />
      </a-form-item>
      <a-form-item label="工序名称" field="name">
        <a-input v-model="entity.name"  />
      </a-form-item>
      <a-form-item label="是否关键工序" field="gj">
        <a-select v-model="entity.gj" placeholder="Please select ..." allow-clear>
          <a-option value="1">是</a-option>
          <a-option value="0">否</a-option>
        </a-select>
      </a-form-item>
      <a-form-item label="标准工时" field="gongshi">
        <a-input v-model="entity.gongshi" />
      </a-form-item>
      <a-form-item label="报工人员" field="ry">
        <a-checkbox-group v-model="entity.ry">
          <a-checkbox value="张三">张三</a-checkbox>
          <a-checkbox value="李四">李四</a-checkbox>
          <a-checkbox value="王五">王五</a-checkbox>
        </a-checkbox-group>
      </a-form-item>
      <a-form-item label="可加工设备" field="sb">
        <a-checkbox-group v-model="entity.sb">
          <a-checkbox value="精锻机器001">精锻机器001</a-checkbox>
          <a-checkbox value="精锻机器002">精锻机器002</a-checkbox>
          <a-checkbox value="精锻机器003">精锻机器003</a-checkbox>
        </a-checkbox-group>
      </a-form-item>
      <a-form-item>
        <a-space>
          <a-button type="primary" @click="">确 定</a-button>
        </a-space>
      </a-form-item>
    </a-form>
  </div>
</template>

<script lang="ts" setup>
import {reactive, ref, onMounted, defineProps, defineEmits, nextTick} from "vue";

const emit = defineEmits(['update:modelValue'])
let props = defineProps({
  modelValue : {type : Boolean, default: true},
  entityId : {type : Number, default: 0}
})

let entity = ref({
  id : props.entityId,
  name: '',
  code: '',
  gj: '',
  gongshi: '',
  ry:[],
  sb:[],
})
const rules = reactive({
  code: [
    { required: true, message: '请输入工序编码', trigger: 'blur' },
  ],
  name: [
    { required: true, message: '请输入工序名称', trigger: 'blur' },
  ],
})

onMounted(()=>{
  nextTick(()=>{
  })
})
</script>

<style scoped>

</style>
